import request from '@/utils/request'

export const queryUserByName = (username) => {
  return request({
    url: '/v1/ruizy/userListByName/',
    method: 'get',
    params: { username }
  })
}


export const getRuizyUserList = (role) => {
  return request({
    url: '/v1/ruizy/userList/',
    params: { role },
    method: 'get'
  })
}

export const saveRuizyUser = (data) => {
  return request({
    url: '/v1/ruizy/user/',
    method: 'post',
    data,
  })
}

// 将菜单权限分配给用户
export const AllocateUserMenu = (data) => {
  return request({
    url: '/v1/ruizy/userMenuAccesses/',
    method: 'post',
    data,
  })
}

// 查询某个用户的菜单权限情况
export function getUserMenusAccess(params){
  return request({
    url: '/v1/ruizy/userMenuAccesses/',
    method: 'get',
    params
  })
}

// 将品种权限分配给用户
export const AllocateUserVariety = (data) => {
  return request({
    url: '/v1/ruizy/userVarietyAccesses/',
    method: 'post',
    data,
  })
}

// 查询某个用户的品种权限情况
export function getUserVarietyAccess(params){
  return request({
    url: '/v1/ruizy/userVarietyAccesses/',
    method: 'get',
    params
  })
}

